/*******************************************************************************
 *
 *    Copyright (c) Baina Info Tech Co. Ltd
 *
 *    Best Wallpaper HD
 *
 *    NotifycationHelper
 *    TODO File description or class description.
 *
 *    @author: zuochen
 *    @since:  2011-8-25
 *    @version: 1.0
 *
 ******************************************************************************/

package great.app.luck.easybatteryrecommend;


import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

/**
 * NotifycationHelper of Best Wallpaper HD.
 * 
 * @author zuochen
 */

public class NotifycationHelper {
	private static final int NOTIFYCATION_ID = 123456789;

	public static void showDailyWallpaperNotifycation(Context context,
			String title, String message, int iconID) {
		final NotificationManager mNotificationManager = (NotificationManager) context
				.getSystemService(Context.NOTIFICATION_SERVICE);
		final Notification notification = new Notification(iconID, message,
				System.currentTimeMillis());
		final PendingIntent contentIntent = PendingIntent.getActivity(context,
				0, new Intent(context, RecommendActivity.class),
				PendingIntent.FLAG_UPDATE_CURRENT);
		notification.setLatestEventInfo(context, title, message, contentIntent);
		notification.flags = Notification.FLAG_NO_CLEAR
				| Notification.FLAG_AUTO_CANCEL;
		mNotificationManager.notify(NOTIFYCATION_ID, notification);
	}

	public static void cancelDailyWallpaperNotifycation(Context context) {
		final NotificationManager notificationManager = (NotificationManager) context
				.getSystemService(Context.NOTIFICATION_SERVICE);
		notificationManager.cancel(NOTIFYCATION_ID);
	}
}
